<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>无标题文档</title>
    <script src="../../js/jquery-1.9.1.js" type="text/javascript"></script>
    <script type="text/javascript">
        var ashx = "http://10.69.25.132/test.ashx";
        function forServer(){
            var xhr;
            xhr = new XMLHttpRequest();
            if (xhr){
                xhr.onerror = function(){alert("错误");};
                //xhr.timeout = 60000;//IE9加上这个属性会报错，不知道为什么，其他版本未测试
                xhr.ontimeout = function(){alert("超时");};
                xhr.onload = function(){
                    var data = $.parseJSON(xhr.responseText);
                    alert(data);
                };
                xhr.open("post", ashx,true);
                xhr.setRequestHeader("Content-type","application/x-www-form-urlencoded");
                xhr.send("p1=guangzhou tianhe");
            }
            else{
                alert("Failed to create");
            }
        }
    </script>


</head>

<body>
</body>
</html>